package com.open.account.infrastructure.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * OpenStatus: 开户进度  * 0 - 草稿  * 1 - CS Pending Check  初核  * 2 - RO Pending Approve – RO审核  * 3 - LCD Pending Approve – LCD审核  * 4 - OPS Pending Check   * 5 - OPS Pending Approve  * 6 - OPS Approved  * 7 - Rejected by Ops 
 */
public enum OpenStatus {
  
  DRAFT(0),

  CS_PENDING_CHECK(1),

  RO_Pending_Approve(2),

  LCD_Pending_Approve(3),

  OPS_Pending_Check(4),

  OPS_Pending_Approve(5),

  OPS_Approved(6),

  Rejected_by_Ops(6);

  private Integer value;

  OpenStatus(Integer value) {
    this.value = value;
  }

  @Override
  @JsonValue
  public String toString() {
    return String.valueOf(value);
  }

  @JsonCreator
  public static OpenStatus fromValue(String text) {
    for (OpenStatus b : OpenStatus.values()) {
      if (String.valueOf(b.value).equals(text)) {
        return b;
      }
    }
    return null;
  }
}

